@echo off
echo Start OFC GUI ...

set webview_path=%cd%
echo %webview_path%

cd ..

rem set root=%cd%
rem set python_path=%root%\Python36\Python36

set PYPATH36=%cd%\Python36\Python36
set PYPATH38=%cd%\Python38\Python38
set PYPATH310=%cd%\Python310\Python310

if exist "%PYPATH36%" (
    echo use python36 env ...
    set python_path=%cd%\Python36\Python36
)

if exist "%PYPATH38%" (
    echo use python38 env ...
    set python_path=%cd%\Python38\Python38
) 

if exist "%PYPATH310%" (
    echo use python310 env ...
    set python_path=%cd%\Python310\Python310
) 

rem current disk
rem %~d0

rem cd %cd%\OSFP-Debug-GUI
cd %webview_path%

rem set PYTHON to environment ariable 
set path=%python_path%;%path%
echo %path%

rem pause

echo Disable console quickedit mode...
reg add HKEY_CURRENT_USER\Console /v QuickEdit /t REG_DWORD /d 00000000 /f


setx GOOGLE_API_KEY "no"
setx GOOGLE_DEFAULT_CLIENT_ID "no"
setx GOOGLE_DEFAULT_CLIENT_SECRET "no"

start "OFC GUI Service" "%python_path%\python.exe" -u "%webview_path%"\run.py
